<template>
  <div style="width: 100%;height: 100%;padding: 12px;">
    <dv-decoration-7 style="height:30px; position: absolute;left: 12px;top: 12px;right:12px; font-size: 14px;">
      主要不良原因
    </dv-decoration-7>
    <dv-conical-column-chart :config="config" style="width:100%;height:100%;" />
  </div>
</template>
<script>
import {getScarpTypeApi} from '../../../api/product/index.js'
export default {
  data() {
    return {
      config: {
        radius: '80%',
        activeRadius: '90%',
        lineWidth: 30,
        data: [],
        showValue: true
      },
      list:[]
    }
  },
  mounted() {
    this.getData()
  },
  methods: {
    getData() {
      const _that = this
      getScarpTypeApi({pkCorp: 1002}).then(res => {
        console.log('getScarpTypeApi',res)

        const {code,data} = res,vals =[]
        if(code === 2000) {
          data.forEach(item => {
            vals.push({
              name: `${item.text}`,
              value: item.qty
            })
          });
        }

        const _config = {..._that.config}
        _config['data'] = vals
        _that.config = _config
      })
    },
  },
}

</script>
